using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using SailHero.Soft.FrameWork.Models;

namespace SailHero.Soft.FrameWork.Mapping.SysAdmin
{
    public class MenuInfoMap : EntityTypeConfiguration<MenuInfo>
    {
        public MenuInfoMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.MenuName)
                .HasMaxLength(150);

            this.Property(t => t.Url)
                .HasMaxLength(150);

            this.Property(t => t.MenuDes)
                .HasMaxLength(4000);

            // Table & Column Mappings
            this.ToTable("MenuInfo");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.MenuName).HasColumnName("MenuName");
            this.Property(t => t.Url).HasColumnName("Url");
            this.Property(t => t.OrderNum).HasColumnName("OrderNum");
            this.Property(t => t.MenuDes).HasColumnName("MenuDes");
            this.Property(t => t.ParentId).HasColumnName("ParentId");
        }
    }
}
